<template>
	<view class="pageBg">
		<groupheader title="人脉详情"></groupheader>
		<card :fromData="fromData" :id="id" @FavoriteEdit="FavoriteEdit"></card>
		<personal :fromData="fromData"></personal>
		<enterpriseInformation :fromData="fromData"></enterpriseInformation>
		<view class="bottomBox" v-if="!vip" @click="navVip">
			<view class="btn">开通VIP</view>
			<view class="tips">VIP可以查看人脉圈联系方式，赠送精品课程</view>
		</view>
	</view>
</template>
<script>
	import card from '@/components/group/card/card.vue';
	import personal from '@/components/group/personal/personal.vue';
	import groupheader from '@/components/group/groupheader/groupheader.vue';
	import enterpriseInformation from '@/components/group/enterpriseInformation/enterpriseInformation.vue';
	export default {
		components: { groupheader, card, personal, enterpriseInformation },
		data() {
			return {
				id: '',
				fromData: {},
				vip: false,
			};
		},
		async onLoad({ id, play }) {
			this.id = id;
			console.log(id, play, 'playplayplay');
			if (play) {
				await this.initLogin();
			}
			this.init();
			const { vip } = uni.getStorageSync('loginData');
			this.vip = vip != 0;
		},
		onShow(e) {},
		methods: {
			navVip() {
				uni.navigateTo({
					url: '/pages/index/vip/vip',
				});
			},
			FavoriteEdit() {
				this.init();
			},
			async init() {
				const res = await this.$api.CardBusinessDetails({ id: this.id });
				this.fromData = res.data;
			},
		},
	};
</script>

<style lang="scss" scoped>
	.pageBg {
		padding-bottom: calc(var(--window-bottom) + 200rpx);
		.bottomBox {
			position: fixed;
			left: 0;
			bottom: 0;
			height: 174rpx;
			width: 100%;
			background-color: $content-bg-colcor;
			overflow: hidden;
			z-index: 99;
			.btn {
				width: 690rpx;
				height: 80rpx;
				background: $price-color;
				border-radius: 40rpx 40rpx 40rpx 40rpx;
				line-height: 80rpx;
				text-align: center;
				color: #fff;
				font-size: $uni-font-size-15;
				margin: 30rpx auto 0;
			}
			.tips {
				color: #999999;
				font-size: $uni-font-size-12;
				margin: $submargin-width auto;
				text-align: center;
				width: 100%;
			}
		}
	}
</style>
